/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package progin.java;

import java.text.DateFormat;
import java.util.Date;

/**
 *
 * @author Hallucinogen
 */
public class Message {
    public Message() {
        mTime = System.currentTimeMillis();
    }

    public Message(User sender, String content) {
        this();
        mSender     = sender;
        mContent    = content;
    }

    public User getSender(){
        return mSender;
    }

    public String getContent(){
        return mContent;
    }

    public void setSender(User sender) {
        mSender = sender;
    }

    public void setContent(String content) {
        mContent = content;
    }

    public long getTime(){
        return mTime;
    }

    public String getFormatedTime() {
        DateFormat df = DateFormat.getInstance();

        return df.format(new Date(mTime));
    }

    private long mTime;
    private User mSender;
    private String mContent;
}
